Is there an Objective-C algorithm like `transform` of the C++ STL?
Posted
by
pesche
on Stack Overflow
See other posts from Stack Overflow
or by pesche
Published on 2011-01-02T15:50:17Z
Indexed on
2011/01/02
15:53 UTC
Read the original article
Hit count: 182
My goal is to have an array that contains all filenames of a specific extension, but without the extension.
There's an elegant solution to get all filenames of a specific extension using a predicate filter and instructions on how to split a path into filename and extension, but to combine them I would have to write a loop (not terrible, but not elegant either).
Is there a way with Objective-C (may be similar to the predicate mechanism) to apply some function to every element of an array and put the results in a second array, like the transform
algorithm of the C++ STL does?
© Stack Overflow or respective owner